<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$siteTitle}</title>
<link href="__ADMIN__/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__ADMIN__/wx/css/default.css">
<script type="text/javascript" src="__ADMIN__/wx/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="__ADMIN__/wx/js/jquery.form.js"></script>
<script type="text/javascript" src="__ADMIN__/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="__ADMIN__/wx/js/ecmall.js" charset="utf-8"></script>
<script type="text/javascript" src="__ADMIN__/wx/js/admin.js" charset="utf-8"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$(".click").click(function() {
			$(".tip").fadeIn(200);
		});

		$(".tiptop a").click(function() {
			$(".tip").fadeOut(200);
		});

		$(".sure").click(function() {
			$(".tip").fadeOut(100);
		});

		$(".cancel").click(function() {
			$(".tip").fadeOut(100);
		});
	});
</script>
<style type="">
.demo{width:620px; margin:30px auto}
			.demo p{line-height:32px}
			.btnfile{position: relative;overflow: hidden;margin-right: 4px;display:inline-block;*display:inline;padding:4px 10px 4px;font-size:14px;line-height:18px;*line-height:20px;color:#fff;text-align:center;vertical-align:middle;cursor:pointer;background-color:#5bb75b;border:1px solid #cccccc;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
			.btnfile input {position: absolute;top: 0; right: 0;margin: 0;border: solid transparent;opacity: 0;filter:alpha(opacity=0); cursor: pointer;}
			.progress { position:relative; margin-left:100px; margin-top:-24px; width:200px;padding: 1px; border-radius:3px; display:none}
			.bar {background-color: green; display:block; width:0%; height:20px; border-radius: 3px; }
			.percent { position:absolute; height:20px; display:inline-block; top:3px; left:2%; color:#fff }
			.files{height:22px; line-height:22px; margin:10px 0}
			.delimg{margin-left:20px; color:#090; cursor:pointer}
			.place{height:40px; background:url(__ADMIN__/images/righttop.gif) repeat-x;}
			.place span{line-height:40px; font-weight:bold;float:left; margin-left:12px;}
			.placeul li{float:left; line-height:40px; padding-left:7px; padding-right:12px; background:url(__ADMIN__/images/rlist.gif) no-repeat right;}
			.placeul li:last-child{background:none;}
			
.topic_hot_list {
			    position: relative;
			    padding: 10px;
			    margin-left: 0!important;
			    margin-right: 16px;
			    margin-bottom: 10px;
			    min-height: 70px!important;
			    width: 200px !important;
			    background-color: #fff;
			    background-image: -webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#fff),color-stop(100%,#fff));
			    background-image: -webkit-linear-gradient(#fff,#fff);
			    background-image: -moz-linear-gradient(#fff,#fff);
			    background-image: -o-linear-gradient(#fff,#fff);
			    background-image: linear-gradient(#fff,#fff);
			    -webkit-box-shadow: inset 0 -1px 0 #e9e9e9,0 1px 0 rgba(0,0,0,0.05);
			    -moz-box-shadow: inset 0 -1px 0 #e9e9e9,0 1px 0 rgba(0,0,0,0.05);
			    box-shadow: inset 0 -1px 0 #e9e9e9,0 1px 0 rgba(0,0,0,0.05);
			    box-shadow: 0 4px 10px rgba(0,0,0,.1);
			}
			.topic_hot_list img {
			    width: 50px!important;
			    height: 50px;
			    border-radius: 6px;
			    -webkit-border-radius: 6px;
			    -moz-border-radius: 6px;
			}
			.topic_hot_list .title {
			    display: block;
			    width: 55%;
			    font-size: 14px;
			    word-wrap: break-word;
			    word-break: break-all;
			    margin-left: 60px;
			    margin-top: 10px;
			}
			.pull-left {
			    float: left;
			}
			
			.topic_hot_list .follow {
			    position: absolute;
			    right: 10px;
			    top: 20px;
			    height: 24px;
			    line-height: 24px;
			    padding-left: 25px;
			    padding-right: 10px;
			    color: white;
			    text-decoration: none;
			    background-repeat: no-repeat;
			    background-attachment: scroll;
			}
			.inner [class*="span"] {
			    display: block;
			    width: 100%;
			    min-height: 11.5em;
			    -webkit-box-sizing: border-box;
			    -moz-box-sizing: border-box;
			    box-sizing: border-box;
			    float: left;
			    margin-left: 2.127659574468085%;
			    max-height: 70px;
    			overflow: hidden;
			}
			.clear{ clear:both}
</style>
</head>
<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="#">首页</a></li>
			<li><a href="#">发放优惠券</a></li>
		</ul>
	</div>
	
	<div class="col_main" style="width: auto;">
   		<form action="{:U('Coupon/sendCoupon')}" method="post">
            <div class="">
                <div class="">
                    <div id="">
                        <div class="" style="margin-top: 0px;">
                        	<div class="appmsg_edit_item">
                                <label for="" class="frm_label">卡券名</label>
                                	<select name="coupon_id" style="width: 150px; border: 1px solid silver; height: 30px;color:#55bd47;">
										<foreach name="coupons" item="coupon">
										<option value="{$coupon.c_id}">{$coupon.title}</option>
										</foreach>
									</select>
                            </div>
                            
                        	<div class="appmsg_edit_item">
                                <label for="" class="frm_label">筛选</label>
                                	<foreach name="citys" item="city">
					            		<input type="checkbox" name="city" value="{$city.select_city}" >{$city.select_city}
					            	</foreach>
                            </div>
                            
                            <div class="inner">
                            	<foreach name="userList" item="user">
			            			<div class="topic_hot_list span selectUser" data-city="{$user.select_city}" data-user-id="{$user.id}">
									<a target="_blank" href="javascript:void(0);" class="icon pull-left">
									<img src="{$user.headerimg}">
									</a>
									<a target="_blank" class="title" href="javascript:void(0);">{$user.username}</a>
									<label class="follow"><input type="checkbox" name="userId[]" value="{$user.id}" ></label>
									</div>
			            		</foreach>
			            		<div class="clear"></div>
                            </div>
                    	</div>
                	</div>
	                <div class="tool_area">
	                    <div class="tool_bar border tc">
	                        <span id="js_submit" class="btn btn_input btn_primary"><button type="submit">保存</button></span>
	                    </div>
	                </div>
            	</div>
        	</div>
        </form>
    </div>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');
		function selectUser(citys) {
			$('.selectUser').each(function () {
				city = $(this).attr('data-city');
				if ($.inArray(city, citys) == -1) {
					$(this).hide();
				} else {
					$(this).show();
				}
			});
		}
		$(function () {
			$('[name="city"]').click(function () {
				var citys = [], leng = $('[name="city"]').length;
				var city = $('[name="city"]').each(function (i, o) {
					if (o.checked) {
						citys.push($(o).val());
					}
					
					if (i == leng - 1) {
						if (citys.length) {
							selectUser(citys);
						} else {
							$('.selectUser').hide();
						}
					}
				});
			});
		});
	</script>
</body>
</html>